package com.woniu.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.model.EUser;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Kevin Kwok
 * @since 2021-04-13
 */
public interface EUserMapper extends BaseMapper<EUser> {

    @Select("select * from e_user limit #{start} , #{pagesize}")
    List<EUser> queryCurrentPageUsers(int start,int pagesize);

    @Select("select count(*) from e_user")
    int countAllRecords();

    @Update("update e_user set status = 2 where id=#{id}")
    int frozenAccount(Integer id);

    @Update("update e_user set id_nunber=#{idNumber} where id = #{id}")
    int editIdNumber(Integer id, String idNumber);

    @Update("update e_user set status=#{status} where id = #{id}")
    int editStatus(Integer id, Integer status);
}
